package com.lyw.log.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j  //@Slf4j 注解，会自动生成一个名为log的Logger对象，可以直接使用 log对象进行日志打印
@RequestMapping("/log2")
@RestController
public class LogController2 {

    @RequestMapping("/print")
    public String print() {
        System.out.println("sout打印日志");
        log.info("info打印日志");

        log.trace("trace打印日志");
        log.debug("debug打印日志");
        log.info("info打印日志");
        log.warn("warn打印日志");
        log.error("error打印日志");

        return "打印日志成功";
    }
}
